#include "USART.h"
/*PB6:USART1_TX PB7:USART1_RX*/
void USART_Init(void)
{
    /*使能时钟*/
    RCC->APBENR2 |= (1<<14);
    /*配置IO*/
    GPIOB->MODER &= 0xffff0fff;
    GPIOB->MODER |= 0x0000a000;
    GPIOB->OSPEEDR &= 0xffffcfff;
    GPIOB->OSPEEDR |= 0x00002000;
    /*配置串口*/
    USART1->CR1 |= 0x0000000c;
    USART1->BRR = 6666;
    USART1_TXIT_ENABLE;
    USART1_RXIT_ENABLE;
    /*使能串口*/
    USART1->CR1 |= 0x00000001;
}
